package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter@Setter
public class SaleOut {
    public static final Integer NORMAL = 1; //为审核
    public static final Integer AUDIT = 2;  //已审核

    private Long id;

    private String sn;  //出库单号
    @DateTimeFormat(pattern = "yyyy-MM-dd")//前台传后台的日期格式化
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")//后台传前台的日期格式化
    private Date vdate; //业务时间

    private Integer status;//状态

    private BigDecimal totalAmount;//出库总额

    private BigDecimal totalNumber;//出库数量
    @DateTimeFormat(pattern = "yyyy-MM-dd")//前台传后台的日期格式化
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")//后台传前台的日期格式化
    private Date auditTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd")//前台传后台的日期格式化
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")//后台传前台的日期格式化
    private Date inputTime;

    private Employee inputUser;//销售人

    private Employee auditor;//审核人

    private Depot depot;//仓库

    private Client client;//客户

    //关联明细
    private List<SaleOutItem> items = new ArrayList<>();
}